Skip to content

Go. Fix tests generation for functions with infinity loop #1911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 9, 2023

Conversation

egiptipavel
Copy link
Collaborator

Description

  • Added maximum trace length (1024).
  • Removed __traces__ global variable - now I change function signature and add __trace__ parameter to it.
  • Refactored Go code.

Fixes #1802

How to test

Manual tests

func InfinityLoop(n int) {
	for {
	}
}

Self-check list

Check off the item if the statement is true. Hint: [x] is a marked item.

Please do not delete the list or its items.

  • I've set the proper labels for my PR (at least, for category and component).
  • PR title and description are clear and intelligible.
  • I've added enough comments to my code, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • Manual tests have been provided optionally.
  • The documentation for the functionality I've been working on is up-to-date.

@egiptipavel egiptipavel added ctg-enhancement New feature, improvement or change request ctg-bug-fix PR is fixing a bug lang-go Issue is related to Go support labels Mar 8, 2023
@egiptipavel egiptipavel requested a review from Markoutte March 8, 2023 15:30
@egiptipavel egiptipavel self-assigned this Mar 8, 2023
@egiptipavel egiptipavel changed the title Go. Fix Go. Fix test generation for functions with infinity loop Mar 8, 2023
@egiptipavel egiptipavel changed the title Go. Fix test generation for functions with infinity loop Go. Fix tests generation for functions with infinity loop Mar 8, 2023
@@ -31,7 +31,7 @@ object GoSourceCodeAnalyzer {
fun analyzeGoSourceFilesForFunctions(
targetFunctionsNamesBySourceFiles: Map<String, List<String>>,
goExecutableAbsolutePath: String
): Pair<Map<GoUtFile, GoSourceFileAnalysisResult>, Int> {
): Triple<Map<GoUtFile, GoSourceFileAnalysisResult>, Int, Int> {
Copy link
Collaborator

@Markoutte Markoutte Mar 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someday it should be converted into a class.

@egiptipavel egiptipavel merged commit 821098a into main Mar 9, 2023
@egiptipavel egiptipavel deleted the egiptipavel/go-infinity-loop branch March 9, 2023 10:46
@alisevych alisevych added this to the 2023.03 Release milestone Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ctg-bug-fix PR is fixing a bug ctg-enhancement New feature, improvement or change request lang-go Issue is related to Go support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Go. UTBot freezes when there is an infinite loop in a function
3 participants